package com.cqjtu.drive.controller;

import com.cqjtu.drive.pojo.RegisterRecord;
import com.cqjtu.drive.response.Response;
import com.cqjtu.drive.service.RegisterRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @Author zxl
 * @Date 2024/6/18 21:58
 */
@RestController
public class RegisterRecordController {
    @Autowired
    RegisterRecordService registerRecordService;

    @PostMapping("/api/registerRecord/getByReAccept")
    public List<Map<String,String>> getByReAccept(){
        return registerRecordService.getAllByReaccept(0);
    }

    @PostMapping("/api/registerRecord/getByreId")
    public Map<String,String> getByReId(@RequestParam String reId){
        return registerRecordService.getRegisterRecordById(reId);
    }

    @PostMapping("/api/registerRecord/update")
    public Response<String> updateReAccept(@RequestBody RegisterRecord registerRecord){
        return registerRecordService.updateRegisterRecord(registerRecord);
    }
}
